package com.usian;

import com.usian.pojo.TbUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "usian-sso-service")
public interface SSOFeign {

    @RequestMapping("/checkUserInfo/{checkValue}/{checkFlag}")
    Boolean checkUserInfo(@PathVariable String checkValue,@PathVariable Integer checkFlag);

    @RequestMapping("/userRegister")
    Boolean userRegister(@RequestBody TbUser tbUser);

    @RequestMapping("userLogin")
    Map<String, String> userLogin(@RequestParam String username, @RequestParam String password);

    @RequestMapping("getUserByToken/{token}")
    TbUser getUserByToken(@PathVariable String token);

    @RequestMapping("logOut")
    Integer logOut(@RequestParam String token);
}
